/*
 * GameObject.cpp
 *
 *  Created on: 08/01/2012
 *      Author: Graciela
 */

#include "GameObject.h"
#include <iostream>

GameObject::GameObject() {
	this->x = 0;
	this->y = 0;
	this->sprite = NULL;
}

GameObject::~GameObject() {
}

void GameObject::translate(int x, int y) {
	this->x += x;
	this->y += y;

	if (sprite != NULL) {
		sprite->setX(this->x);
		sprite->setY(this->y);
	}
}

void GameObject::setPosition(int x, int y) {
	this->x = x;
	this->y = y;

	if (sprite != NULL) {
		sprite->setX(this->x);
		sprite->setY(this->y);
	}
}

int GameObject::getX() {
	return x;
}

SpriteInstance *GameObject::getSpriteInstance() const {
	return sprite;
}

void GameObject::setSpriteInstance(SpriteInstance *sprite) {
	this->sprite = sprite;
}

int GameObject::getY() {
	return y;
}
